package cuiying;

public class Cat {
    private String name;

    public Cat(String name){
        this.name=name;
    }
    public void printInfo()
    {
        System.out.print(name);
    }
    public void mew()
    {
        printInfo();
        System.out.println("在喵喵喵叫");
    }
    public void eat(String food)
    {
        printInfo();
        System.out.println("在吃"+food);
    }
    void catchMouse(Mouse m){
        System.out.println(this.name+"抓住了"+m.getName());
        this.mew();
        m.squeak();
    }

}